\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs28\fc0\cf0 Q: How can I change my password from a non-NEXTSTEP system, given that the NIS (formerly known as Yellow Pages or "YP") database is mastered by NetInfo?\
\
A: Replace the standard yppasswd command on the non-NEXTSTEP system with a shell script that rsh's the NetInfo master server and passes the arguments on as arguments to passwd. Something like:\
\
\f1\fs24 #\
# replace the yppasswd command on your non-NeXT machine with this shell\
# script. This shell script checks if it received a username as an\
# argument, if not it will default to the user that executes the command.\
# The script turns echo off, logs into the configuration server and runs\
# the passwd command that updates the NetInfo database. It then restores\
# the echo status to it's initial value.\
#\
\
#!/bin/csh\
set Server = "ni_server"\
set Account = $\{1\}\
if ($\{Account\} == "") then\
set Account = `whoami`\
endif\
(stty > /dev/tty) |& grep '.-echo' >& /dev/null\
if ( $\{status\} != 0 ) then\
set NoEcho=0\
else\
set NoEcho=1\
endif\
\
stty -echo\
rsh $\{Server\} /bin/passwd $Account\
if ( $\{NoEcho\} == 0 ) then\
stty echo\
endif\
\f0\fs28 \
Then, every 5 minutes (or 15, or 30...), have cron test for changes in the password file by nidumping and comparing. If they are different, automatically perform a ypmake for the password file. Alternately, have the rsh touch a file on the master server that causes cron to dump and push the database.\
\
Replace
\f1\fs24 ni_server
\f0\fs28 in the above shell script with the name of your configuration server. The shell script assumes that the hosts are equivalent, see the man page for hosts.equiv(5) for more information. Be sure to make this shell script read-only and set its ownership to root.\
\
\
QA556\
\
\pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\fc0\cf0 Valid for 1.0, 2.0, 3.0, 3.1\